fix(screenscraper): respect region priority for multi-region ROMs#3396
Merged
Conversation
For ROMs tagged with multiple regions (e.g. "(Japan, USA)"), filename order previously decided which region's name and box art won. Now reorder the rom's filename-tagged regions by SCAN_REGION_PRIORITY before prepending, so the user's configured preference wins among the regions the file is actually tagged as. Untagged priority regions still cannot outrank a filename-tagged region. Also tweak the Total Rescan → Complete Rescan label in en_GB/en_US scan locales. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts ScreenScraper region selection so multi-region ROM filename tags are reordered according to SCAN_REGION_PRIORITY, ensuring the configured preference wins among regions actually present on the ROM. Also updates the scan UI copy for the rescan type label.
Changes:
- Reorders filename-derived region codes in
get_preferred_regions()usingSCAN_REGION_PRIORITYbefore applying fallbacks. - Adds tests covering multi-region priority, untagged-priority behavior, and preservation of filename order for unprioritized tags.
- Updates en_US/en_GB scan locale text from “Total Rescan” to “Complete Rescan”.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| frontend/src/locales/en_US/scan.json | Updates rescan label text in the scan types help string. |
| frontend/src/locales/en_GB/scan.json | Updates rescan label text in the scan types help string. |
| backend/tests/handler/metadata/test_ss_handler.py | Adds multi-region test coverage for preferred region ordering behavior. |
| backend/handler/metadata/ss_handler.py | Sorts ROM-tagged regions by configured priority before building the provider region preference list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Contributor
Contributor
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
pull Bot
pushed a commit
to dwongdev/romm
that referenced
this pull request
May 23, 2026
A COMPLETE rescan never deleted previously downloaded asset files, and the post-scan download steps skip work when a file already exists (store_media_file) or when the source URL is unchanged (get_cover). This meant covers, screenshots, manuals, and SS/gamelist/LaunchBox extended media were reused even when a fresh fetch returned a different URL — defeating the region-priority fix in rommapp#3396. - scan socket: for a COMPLETE rescan of an existing ROM, remove the cover, manual, screenshots, and all extended media directories before re-fetching, so the download steps pull fresh files. - scan_handler: reset url_cover/url_screenshots/url_manual and the matching path_* fields for COMPLETE rescans before the priority loops run, so stale DB values are nulled when no selected source supplies them (clearing for deselected sources falls out as a subset). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Zaxxon's Motherbase 2000 (Japan, USA) (En).zip), filename order previously decided which region's name and box art ScreenScraper returned.get_preferred_regions()now reorders the rom's filename-tagged regions bySCAN_REGION_PRIORITYbefore prepending them, so the user's configured preference wins among the regions the file is actually tagged as.SCAN_REGION_PRIORITYthat the file is NOT tagged as still cannot outrank a region the file IS tagged as — this only re-sorts among filename-tagged regions.Total Rescan→Complete Rescan) that was already staged.Test plan
DB_HOST=127.0.0.1 uv run pytest tests/handler/metadata/test_ss_handler.py::TestGetPreferredRegions -v(7 passed)SCAN_REGION_PRIORITYset, confirm the preferred region's name and box art are picked.🤖 Generated with Claude Code